package com.zy.dp.iterator.example6;

public class Client
{
	public static void main(String[] args)
	{
		SalaryManager salaryManager = new SalaryManager();
		salaryManager.calcSalary();

		Iterator it = salaryManager.createIterator();
		it.first();

		if (!it.isDone())
		{
			PayModel pm = (PayModel) it.currentItem();
			System.out.println("next1 == " + pm);
			it.next();
		}
		if (!it.isFirst())
		{
			it.previous();
			PayModel pm = (PayModel) it.currentItem();
			System.out.println("previous1 == " + pm);
		}
		if (!it.isDone())
		{
			PayModel pm = (PayModel) it.currentItem();
			System.out.println("next2 == " + pm);
			it.next();
		}
		if (!it.isDone())
		{
			PayModel pm = (PayModel) it.currentItem();
			System.out.println("next3 == " + pm);
			it.next();
		}
		if (!it.isFirst())
		{
			it.previous();
			PayModel pm = (PayModel) it.currentItem();
			System.out.println("previous2 == " + pm);
		}

	}
}
